<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<link rel="stylesheet" href="./css/usercenter.css">
<script src="./js/promiseajax.js"></script>
<script src="./js/cookie.js"></script>

<body>
    <!-- <a href="useredit.html">修改</a> -->
    <div class="box">

    </div>


</body>
<script>
    request({
        url: '/api/users/getUsers/' + getCookie('userid'),
        headers: {
            Authorization: localStorage.getItem('token')
        }
    }).then(res => {
        console.log(res);
        var html = `
        <table border="1">
        <caption>用户信息</caption>
        <tr>
            <td>用户名</td>
            <td>${res.data.username}</td>
        </tr>
        <tr>
            <td>密码</td>
            <td>*****<a href="pwdchange.html">修改密码</a></td>
        </tr>
        <tr>
            <td>邮箱</td>
            <td>${res.data.email}</td>
        </tr>
    </table>
`
        document.querySelector('.box').innerHTML = html
    })

</script>

</html>